package me.zhengjie.app.system.service.dto;

import lombok.Data;
import me.zhengjie.modules.security.service.dto.JwtUserDto;

@Data
public class UserInfo {
    private String openId;

    private String realname;

    private String password;

    private String mobile;

    private String gender;

    private String email;

    private String headimgurl;

    private String department;

    private String roles;

    public UserInfo(JwtUserDto jwtUser) {
        this.openId = jwtUser.getUser().getId().toString();
        this.realname = jwtUser.getUser().getNickName();

        this.mobile = jwtUser.getUser().getPhone();
        this.email = jwtUser.getUser().getEmail();
        this.password = jwtUser.getPassword();
        this.gender = jwtUser.getUser().getGender();
        this.department = jwtUser.getUser().getDept().getName();
        this.headimgurl = jwtUser.getUser().getAvatarPath();
        this.roles = "";
    }
}
